﻿<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TargetCostAdjustZjSP_ExtendForm.aspx.vb" Inherits="PubProject.TargetCostAdjustZjSP_ExtendForm" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o="urn:schemas-microsoft-com:office:office">
	<HEAD>
		<title></title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<link rel="stylesheet" type="text/css" href="/_forms/styles/form.css">
		<script language="javascript" src="/_common/scripts/global.js"></script>
		<script language="javascript" src="/_controls/settings.aspx"></script>
		<script language="javascript" src="/_controls/util/util.js"></script>
		<script language="javascript" src="/_controls/number/number.js"></script>
		<script language="javascript" src="/_controls/datetime/date.js"></script>
		<script language="javascript" src="/MyWorkflow/Workflow.js"></script>
		<script language="javascript" src="/MyWorkflow/Blank.js"></script>
		<script language="javascript" src="/PubProject/js/Public.js"></script>		
		<script language="javascript" src="/CBGL/JS/BudgetCostUse.js"></script>
		<script language="javascript" src="/CBGL/HTZX/HtBudget_Setup.js"></script>
		<script language="javascript" src="/CBGL/JS/StockCostUse.js"></script>
		<script language="javascript" src="/CBGL/JS/Public.js"></script>
		<style> body{font-size:9pt;}
	table{font-size:9pt;}
	P{font-size:9pt;}
		</style>
		<LINK href="/MyWorkflow/css/form.css" type="text/css" rel="stylesheet">
		<script language="javascript">
		    var ObjBudgetCostUse = null;//选择合约规划类
//			var ObjStockCostUse = null; //选择公司库存类
//			var IfDdhs=null;            //是否单独执行
			 var sCfTypeName,sCfSouce,sRefType,sRefGUID,sContractGUID;
			/*------------------------------------------------------------------*/
			//表单接口函数，需扩展
			//1、Fill	--	表单填充
			//2、GetXML --	表单取数
			//3、Valid	--	表单校验
			/*------------------------------------------------------------------*/
			//屏避右键
			function document.oncontextmenu()
			{
				var s = event.srcElement.tagName;
				// For Selection Ranges, s will be UNDEFINED
				if (s && s != "INPUT" && s != "TEXTAREA" || event.srcElement.disabled || document.selection.createRange().text.length == 0)
				{
					event.returnValue = false;
				}
			}
			//功能：表单填充
			//editableDomainList	当前步骤可编辑域
			//invisibleDomainList   当前步骤不可见域
			//domainXML				域XML
			function Fill(editableDomainList,invisibleDomainList,domainXML)
			{
				var xmlDom = new ActiveXObject("Microsoft.XMLDOM"); 
//			 	Form1.TxtUseCostInfo.setReadOnly(true, false);
//	            Form1.TxtUseCostInfo.style.cursor = "hand"
//	            Form1.TxtUseCostInfo.style.textDecorationUnderline = "true"
//                //debugger;
				if (domainXML && domainXML.length>0)	
				{		
					xmlDom.async=false; 
					xmlDom.loadXML(domainXML);
					
					if(xmlDom.parseError.errorCode != 0) 
						xmlDom = null; 
				}
				else
				{
					xmlDom = null;
				}
 
				Form1.TxtProjectName.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='项目名称']").text;
				Form1.txtTcDept.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='提出部门']").text;				
				Form1.txtDate.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='日期']").text;				
				Form1.txtTargetCost.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='目标成本']").text;
				Form1.txtOldTargetCost.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='相关原目标成本']").text;
				Form1.txtYjzjCost.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='预计增减成本']").text;
				Form1.txtZjReason.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='增减原因']").text;
				Form1.txtCostWay.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='成本增减消化方法']").text;
				Form1.txtJbr.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='经办人']").text;
				Form1.txtJbTime.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='经办时间']").text;
				Form1.txtYjsbYj.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='预决算部门意见']").text;
				Form1.txtCujlYj.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='财务经理意见']").text;
				Form1.txtFgfzYj.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='分管副总意见']").text;
				Form1.txtYjjl.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='研究结论']").text;
				Form1.txtZjed.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='增减额度']").text;
				Form1.txtFtff.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='分摊方法']").text;
				Form1.txtZjlYj.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='总经理意见']").text;
				Form1.txtJtzxYj.value = xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='集团中心意见']").text;
				
				var objlist = getHTMLDomainField(document);
				//debugger;
				for(var i=0;i<objlist.length;i++)
				{ 	
					if((invisibleDomainList+",").indexOf(objlist[i].dm_name + ',')>-1)
					{
						//不可见域不显示
						objlist[i].style.display="none";
					}
				
					//不可编辑的disabled,可编辑的enabled
					if((editableDomainList+",").indexOf(objlist[i].dm_name + ',')>-1)
					{
						objlist[i].readOnly =false;
					}
					else
					{
						objlist[i].readOnly =true;
					}
				}
				sRefGUID = xmlDom.selectSingleNode("/BusinessType").attributes.getNamedItem("BusinessGUID").value;
				if(sRefGUID!=undefined && sRefGUID !=""){
				    document.all("AdjustInfo").src = "/PubProject/workflow/cbgl/TargetCostAdjustZjSP_ExtendForm_Table.aspx?AdjustGUID=" + sRefGUID + "&mode=3&type=" + escape("目标追加科目列表") ;
				}
//				var sFile = "/Cbgl/HTZX/HTBalance_XMLHTTP.aspx?sTypeName=alter&RefGUID=" + escape(sRefGUID);
//				var sRtn = openXMLHTTP(sFile,"GetBalanceBudgetInfo");
//                if ("NO"!=sRtn)
//                {
//                   var sRtnList = sRtn.split("|")
//                   sContractGUID = sRtnList[1];
//                   document.all.txtAlterBudgetList.value=sRtnList[0];
//                }
			}
			
			//功能：表单取数
			//参数：取值前的domainxml
			//返回值 取值后的domainxml
			function GetXML(domainXML)
			{
			//debugger;
				var xmlDom = new ActiveXObject("Microsoft.XMLDOM");
				 
				xmlDom.async=false;
				xmlDom.loadXML(domainXML);
						
				if(xmlDom.parseError.errorCode != 0) return "";
				 
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='项目名称']").text = Form1.TxtProjectName.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='提出部门']").text = Form1.txtTcDept.value;				
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='日期']").text = Form1.txtDate.value;				
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='目标成本']").text = Form1.txtTargetCost.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='相关原目标成本']").text = Form1.txtOldTargetCost.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='预计增减成本']").text = Form1.txtYjzjCost.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='增减原因']").text = Form1.txtZjReason.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='成本增减消化方法']").text = Form1.txtCostWay.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='经办人']").text = Form1.txtJbr.value ;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='经办时间']").text = Form1.txtJbTime.value;				
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='预决算部门意见']").text = Form1.txtYjsbYj.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='财务经理意见']").text = Form1.txtCujlYj.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='分管副总意见']").text = Form1.txtFgfzYj.value;				
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='研究结论']").text = Form1.txtYjjl.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='增减额度']").text = Form1.txtZjed.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='分摊方法']").text = Form1.txtFtff.value;				
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='总经理意见']").text = Form1.txtZjlYj.value;
				xmlDom.selectSingleNode("/BusinessType/Item/Domain[@name='集团中心意见']").text = Form1.txtJtzxYj.value;
			
				return xmlDom.xml;	
			}
			
			//功能：表单校验
			//参数：可编辑域列表
			function Valid(editableDomainList)
			{
				return true;
			}
			

</script>
	</HEAD>
	<body MS_POSITIONING="GridLayout" id="bodyId">
		<form id="Form1" method="post" runat="server">
			<asp:textbox id="ApplyUserGUID" runat="server" style="display:none"></asp:textbox>
			<asp:textbox id="ApplyDeptGUID" runat="server" style="display:none"></asp:textbox>
			<asp:textbox id="ResultTypeGUID" runat="server" style="display:none"></asp:textbox>
			<asp:textbox id="WorkResultGUID" runat="server" style="display:none"></asp:textbox>	
			<asp:textbox id="txtAlterBudgetList" style="DISPLAY: none" Runat="server"></asp:textbox>

			<TABLE width="100%">
				<TBODY>
					<TR>
						<TD><!-- 表单 -->
							<P align="center" id="pTitle"><FONT style="FONT-SIZE: 16px"><STRONG>目标成本调整目标追加审批表</STRONG></FONT></P>
							<P align="center">
								<TABLE style="TABLE-LAYOUT: fixed; WIDTH: 90%; BORDER-COLLAPSE: collapse" borderColor="#517dbf"
									cellSpacing="2" cellPadding="3" align="center" bgColor="#ffffff" border="1">
									<colgroup>
										<col width="100">
										<col>
										<col width="100">
										<col>										
									</colgroup>
									<TR height="25">
										<TD>
											项目名称
										</TD>
										<TD colspan="3">
											<INPUT class="txt" id="TxtProjectName" style="WIDTH: 100%; HEIGHT: 100%" maxLength="4000" dm_name="项目名称">
										</TD>							
									</TR>
									<TR height="200">
										<TD colspan=4>
										    <table  style="TABLE-LAYOUT: fixed; WIDTH: 100%; BORDER-COLLAPSE: collapse" borderColor="#517dbf"
									cellSpacing="2" cellPadding="3" align="center" bgColor="#ffffff" border="1">
										        <tr>
										            <td rowspan=7 style="width:100px">经办部门填写</td>
										            <td style="width:100px">提出部门</td>
										            <td>
										                <INPUT class="txt" id="txtTcDept" style="WIDTH: 100%; HEIGHT: 100%" maxLength="300" dm_name="提出部门">
										            </td>
										            <td style="width:100px">日期</td>
										            <td>
										                <INPUT class="txt" id="txtDate" style="WIDTH: 100%; HEIGHT: 100%" maxLength="300" dm_name="日期">
										            </td>
										        </tr>
										        <tr>
										            <td>目标成本</td>
										            <td colspan=3>
										                <INPUT class="txt" id="txtTargetCost" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="目标成本">
										            </td>
										        </tr>
										        <tr>
										            <td>相关原目标成本</td>
										            <td>
										                <INPUT class="num" id="txtOldTargetCost" style="WIDTH: 100%; HEIGHT: 100%" maxLength="20" dm_name="相关原目标成本" acc="2">
										            </td>
										            <td>预计增减成本</td>
										            <td>
										                <INPUT class="num" id="txtYjzjCost" style="WIDTH: 100%; HEIGHT: 100%" maxLength="20" dm_name="预计增减成本" acc="2">
										            </td>
										        </tr>
										        <tr>
										            <td>增减原因</td>
										            <td colspan=3>
										                <INPUT class="txt" id="txtZjReason" style="WIDTH: 100%; HEIGHT: 100%" maxLength="5000" dm_name="增减原因">
										            </td>
										        </tr>
										        <tr>
										            <td>成本消化方法</td>
										            <td colspan=3>
										                <INPUT class="txt" id="txtCostWay" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="成本消化方法">
										            </td>
										        </tr>
										        <tr>
										            <td>经办人</td>
										            <td>
										                <INPUT class="txt" id="txtJbr" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="经办人">
										                
										            </td>
										            <td>经办时间</td>
										            <td>
										                <INPUT class="txt" id="txtJbTime" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="经办时间">
										            </td>
										        </tr>
										    </table>
										</TD>
									</TR>
									<TR height="30">
										<TD align=center>
											预决算部门意见
										</TD>
										<TD colspan=3>
                                            <INPUT class="txt" id="txtYjsbYj" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="预决算部门意见">
										</TD>										
									</TR>
									<TR height="30">
										<TD align=center>
											财务经理意见
										</TD>
										<TD colspan=3>
                                            <INPUT class="txt" id="txtCujlYj" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="财务经理意见">
										</TD>										
									</TR>
									<TR height="30">
										<TD align=center>
											分管副总意见
										</TD>
										<TD colspan=3>
                                            <INPUT class="txt" id="txtFgfzYj" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="分管副总意见">
										</TD>										
									</TR>
									<TR height="140">
										<TD colspan=4>
											<table   style="TABLE-LAYOUT: fixed; WIDTH: 100%; height:100%; BORDER-COLLAPSE: collapse" borderColor="#517dbf"
									cellSpacing="2" cellPadding="3" align="center" bgColor="#ffffff" border="1">
                                                <tr>
                                                    <td rowspan=3 style="width:130px" align=center>公司办公会研究结论(经办部主管领导填写)</td>
                                                    <td style="width:100px">研究结论：</td>
                                                    <td>
                                                        <INPUT class="txt" id="txtYjjl" style="WIDTH: 100%; HEIGHT: 20px" maxLength="100" dm_name="研究结论">
                                                    </td>
                                                </tr>
                                                 <tr>
                                                    <td>增减额度：</td>
                                                    <td>
                                                        <INPUT class="txt" id="txtZjed" style="WIDTH: 10%; HEIGHT: 20px" maxLength="100" dm_name="增减额度"> 万元
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>分摊方法：</td>
                                                    <td>
                                                        <INPUT class="txt" id="txtFtff" style="WIDTH: 100%; HEIGHT: 20px" maxLength="100" dm_name="分摊方法">
                                                    </td>
                                                </tr>
                                           </table>
										</TD>										
									</TR>
									<TR height="30">
										<TD align=center>
											总经理意见
										</TD>
										<TD colspan=3>
                                            <INPUT class="txt" id="txtZjlYj" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="总经理意见">
										</TD>										
									</TR>
									<TR height="30">
										<TD align=center>
											集团中心意见
										</TD>
										<TD colspan=3>
                                            <INPUT class="txt" id="txtJtzxYj" style="WIDTH: 100%; HEIGHT: 100%" maxLength="100" dm_name="集团中心意见">
										</TD>										
									</TR>
									<TR>
									    <TD colspan=4 height=160>
									        <iframe id="AdjustInfo" frameborder="0" height="100%" width="100%" scrolling="auto"
									    </TD>
									</TR>
								</TABLE>
							</P>
						</TD>
					</TR>					
				</TBODY>
			</TABLE>
		</form>
	</body>
</HTML>